<template>
  <el-cascader v-model="inputValue" :options="options" v-bind="{
    ...$attrs,
    props: props,
    placeholder: $attrs.placeholder || '请选择'
  }" v-on="$listeners"></el-cascader>
</template>

<script>
import inputValueMixin from '@/mixins/inputValueMixin'
import {
  getOptionTree,
} from "@/api/system/dict";
export default {
  name: 'CategoryTreeSelect',
  mixins: [inputValueMixin],
  props: {
  },
  data() {
    return {
      options: [],
      props: {
        value: 'code',
        label: 'dictValue'
      }
    };
  },
  methods: {
    getOptionTree() {
      getOptionTree({ code: 'added_service' }).then(res => {
        this.options = res.data.data
        this.$emit('afterLoaded', this.options)
      })
    }
  },
  created() {
    this.getOptionTree()
  }
};
</script>

<style scoped lang="scss">

</style>
